#include <stdio.h>
#include <omp.h>

void host_compute(int *sum);

int main() {
    int sum = 0;
    
    #pragma omp parallel sections reduction(+:sum)
    {
        #pragma omp section
        host_compute(&sum);
        
        #pragma omp section
        host_compute(&sum);
    }
    
    printf("sum = %d\n", sum);
    return 0;
}

void host_compute(int *sum) {
    *sum += 1;
}